home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 15 / 015.d81 / pps #37 < prev    next >
Text File  |  2022-08-26  |  5KB  |  285 lines

  1.  
  2. ======================================
  3.    PEEKs, POKEs, & SYSes -- Part 37
  4.  
  5.         By James Gelatin Weiler
  6.           and Ailing Gardner
  7. ======================================
  8.  
  9.   Last time we told you that next
  10.  
  11. time we hoped to have a version of
  12.  
  13. the SYSPLOTTER routines that would
  14.  
  15. draw lines.  This time we can tell
  16.  
  17. you that we really do have what we
  18.  
  19. told you last time we would have next
  20.  
  21. time.
  22.  
  23.   For everyone who wasn't with us
  24.  
  25. last time, here's a reprise of what
  26.  
  27. you missed:
  28.  
  29.   SYSPLOTTER is a set of machine
  30.  
  31. language routines that make
  32.  
  33. high-resolution graphics work easily
  34.  
  35. and quickly from within a BASIC
  36.  
  37. program.  There are commands to turn
  38.  
  39. graphics on and off, to change the
  40.  
  41. background and pen color, to draw or
  42.  
  43. erase points, and to clear the whole
  44.  
  45. high-resolution screen.
  46.  
  47.   Now SYSPLOTTERB adds commands to
  48.  
  49. draw horizontal and vertical lines.
  50.  
  51. Here, again, is the complete list of
  52.  
  53. commands available:
  54.  
  55. ======================================
  56.   Bit-mapped graphics: how to do it
  57.    using the SYSPLOTTERB routines.
  58. - - - - - - - - - - - - - - - - - - -
  59.  
  60.  
  61.   First, load the routines:
  62.  
  63.  
  64. 3 IFL=0THENL=1:LOAD"SYSPLOTTERB.O",8,1
  65.  
  66.  
  67. After that, it gets simple fast.
  68.  
  69.  
  70. A. SETGRAPHIC
  71.    To set the bit mapped graphics
  72.    mode, SYS 49152.
  73.  
  74. B. CLEARGRAPHIC
  75.    To clear the graphics screen,
  76.    SYS 49158.
  77.  
  78. C1.COLORSMEAR
  79.    To set the background color,
  80.    SYS 49161, <0-15>.
  81.  
  82. C2.PLOTCOLOR
  83.    To set the "pen" color,
  84.    SYS 49164, <0-15>.
  85.  
  86. D1.DRAW
  87.    To plot a point,
  88.    SYS 49167, <0-319>, <0-199>.
  89.  
  90. D2.ERASE
  91.    To erase a point,
  92.    SYS 49170, <0-319>, <0-199>.
  93.  
  94. E1.HRIZLINE
  95.    To plot a horizontal line,
  96.    SYS 49176,<0-319>,<0-319>,<0-199>
  97.  
  98. E2.VERTLINE
  99.    To plot a vertical line,
  100.    SYS 49173,<0-199>,<0-199>,<0-319>
  101.  
  102. F. UNGRAPHIC
  103.    To turn off the graphics screen
  104.    and return to the text screen,
  105.    SYS 49155.
  106.  
  107. ======================================
  108.  
  109.   Now the details.
  110.  
  111.  
  112. SETGRAPHIC (49152), UNGRAPHIC (49155),
  113.  
  114. and CLEARGRAPHIC (49158) are just
  115.  
  116. simple SYSes.
  117.  
  118.  
  119.  
  120. SETGRAPHIC turns on the bit-mapped
  121.  graphic screen with a base address
  122.  of 8192.
  123.  
  124. UNGRAPHIC turns on the normal text
  125.  screen.
  126.  
  127. CLEARGRAPHIC erases any bit-mapped
  128.  pattern on the high-resolution
  129.  screen.  It is equivalent to poking
  130.  zeros into all memory locations from
  131.  8192 to 16191.
  132.  
  133. - - - - - - - - - - - - - - - - - - -
  134.  
  135. COLORSMEAR (49161) & PLOTCOLOR (49164)
  136.  
  137. are SYSes that must be followed by a
  138.  
  139. comma and one numeric expression.
  140.  
  141.   The numeric expression should
  142.  
  143. evaluate from 0 to 15.  It selects the
  144.  
  145. color of the background or pen for the
  146.  
  147. entire screen.  The numeric expression
  148.  
  149. can be a constant, a variable, or
  150.  
  151. an expression.
  152.  
  153. Examples:
  154.  
  155. COLORSMEAR --
  156.  
  157. SYS 49161,2
  158.  
  159.  will change the backgrond color of
  160.  the entire screen to red.
  161.  
  162.  
  163. PLOTCOLOR --
  164.  
  165. Z = 0: SYS 49164,Z
  166.  
  167.  will change the color of all the
  168.  plotted points on the screen to
  169.  black.
  170.  
  171. - - - - - - - - - - - - - - - - - - -
  172.  
  173. DRAW (49167) and ERASE (49170) are
  174.  
  175. SYSes that must be followed by two
  176.  
  177. numeric expressions separated by
  178.  
  179. commas.  The first expression is
  180.  
  181. the horizontal position to plot and
  182.  
  183. should be in the range 0 to 319.
  184.  
  185. The second expression is the vertical
  186.  
  187. position and should be from 0 to 199.
  188.  
  189.  
  190. Examples:
  191.  
  192. -- DRAW --
  193. FOR A = 0 to 20
  194. SYS 49167,A,A
  195. NEXT A
  196.  
  197.  will draw a short diagonal line in
  198.  the upper left corner of the screen.
  199.  
  200.  
  201. -- ERASE --
  202. FOR A = 0 to 10
  203. SYS 49170,A*2,A*2
  204. NEXT A
  205.  
  206.  will turn the diagonal line we drew
  207.  in the previous example into a dotted
  208.  line by turning off every other dot
  209.  along its length.  Erase will turn
  210.  off any dot, but you won't see it
  211.  working unless the dot was already
  212.  on.
  213.  
  214. - - - - - - - - - - - - - - - - - - -
  215.  
  216. HRIZLINE (49176) and VERTLINE (49173)
  217.  
  218. are SYSes that must be followed by
  219.  
  220. three numeric expressions separated
  221.  
  222. by commas.
  223.  
  224.   In HRIZLINE, the first and second
  225.  
  226. expressions are the left and right
  227.  
  228. points of the line.  The lesser will
  229.  
  230. always be used as the leftmost point.
  231.  
  232. If the first two expressions are
  233.  
  234. equal, HRIZLINE will plot a single
  235.  
  236. point.  The last expression is the
  237.  
  238. vertical position of the line.
  239.  
  240.   In VERTLINE, the first and second
  241.  
  242. expressions are the top and bottom
  243.  
  244. points of the line.  The lesser will
  245.  
  246. always be used as the top point.  If
  247.  
  248. the first two expressions are equal,
  249.  
  250. VERTLINE will plot a single point.
  251.  
  252. The last expression is the horizontal
  253.  
  254. position of the line.
  255.  
  256. ======================================
  257.  
  258.   The machine-language SYSPLOTTERB
  259.  
  260. routines are on Side 2 of this issue
  261.  
  262. of LOADSTAR. They were written by
  263.  
  264. Ailing Gardner with the MERLIN
  265.  
  266. assembler.  James Gelatin Weiler has
  267.  
  268. written a BASIC program to
  269.  
  270. demonstrate the SYSPLOTTERB routines.
  271.  
  272. The demo program includes a
  273.  
  274. subroutine to print numbers and
  275.  
  276. letters on the high-resolution screen
  277.  
  278. to aid in graph making.
  279.  
  280.   If you wish to view the SYSPLOTTERB
  281. \oad"plottext b demo",8
  282. demo, press the '\' key now.
  283.  
  284. --------< end of article >-----------
  285.